package com.ruoyi.yipaiju.controller;

import com.google.common.collect.ImmutableMap;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.ApiResult;
import com.ruoyi.yipaiju.domain.Roles;
import com.ruoyi.yipaiju.service.IRolesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/roles")
public class RolesController extends BaseController {

    @Autowired
    private IRolesService rolesService;


    /**
     * TODO 角色列表 不知道这块咋整
     * @return
     */
    @GetMapping("")
    public ApiResult roles(Roles roles)
    {
        // 返回一个角色结果集
        // TODO roles
        return ApiResult.success(ImmutableMap.of("results", rolesService.selectRolesList(roles)));
    }

}
